<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      class="content-parent"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style3/Level2outlineStyle4Bg.webp'})`,
      }"
    >
      <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
        <!-- digitalShowroom -->
        <digitalShowroomIcon :url="props.info.digitalShowroom" />
      </div>
      
      <div
        class="content"
        :class="{
          content3: props.info.value && !props.info.remarks && !props.info.subTitle,
          content4: props.info.value && props.info.remarks && !props.info.subTitle,
          content2: props.info.value && !props.info.remarks && props.info.subTitle,
        }"
      >  
        <!-- 标题 -->

        <div
          class="title" 
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style3/Level2outlineStyle4BgTitle.webp'})`,
          }"
        >
          {{ props.info.text }}
        </div>

        <!-- 内容区 -->
        <div class="subtitle" v-if="props.info.subTitle">
          {{ props.info.subTitle }}
        </div>
        <div class="img-box" v-if="props.info.value">
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
        <div class="remarks1" v-if="props.info.value && props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="4"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          v-else-if="props.info.remarks"
          :class="{
            remarks3: !props.info.subTitle,
          }"
        >
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="props.info.subTitle ? 4 : 11"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style24',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style1.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax3.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
const getIndex = computed(() => {
  let index = 0;
  const num = ['壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '拾', '拾壹', '拾贰', '拾叁', '拾肆', '拾伍'];
  store.templateMOdeList.forEach((el, indexs) => {
    if (el.id === props.info.id) {
      index = indexs;
    }
  });
  return num[index];
});
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
  margin-right: 140px;
  margin-left: 80px;
  margin-top: 0;
}
.content-parent {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 626px;
  height: 774px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 122px 62px 122px 179px;
}
.content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 387px;
  height: 530px;
}

.title {
  display: flex;
  align-items: center;
  height: 72.56px;
  width: 384px;
  position: relative;
  z-index: 5;
  font-family: SourceBold;
  font-size: 24px;
  color: #2f1b16;
  line-height: 36px;
  text-align: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 18px 0;
  padding-bottom: 19px;
}

.subtitle {
  width: 343px;
  font-family: SourceMedium;
  font-size: 18px;
  color: #2f1b16;
  line-height: 24px;
  text-align: center;
  opacity: 0.5;
  margin-top: 20px;
}
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 384px;
  height: 222px;
  background: #623333;
  margin-top: 20px;
  border-radius: 8px;
  overflow: hidden;
}
.outline-cover {
  width: 384px;
  height: 222px;
  object-fit: contain;
  transition: all 0.3s;
}
.content4 {
  .img-box {
    width: 384px;
    height: 328px;
  }
  .outline-cover {
    width: 384px;
    height: 328px;
  }
}
.content2 {
  .img-box {
    width: 384px;
    height: 328px;
  }
  .outline-cover {
    width: 384px;
    height: 328px;
  }
}
.content3 {
  .img-box {
    width: 384px;
    height: 328px;
  }
  .outline-cover {
    width: 384px;
    height: 328px;
  }
}

.outline-cover:hover {
  transform: scale(1.1);
}

.remarks1 {
  position: relative;
  width: 384px;
  margin-top: 20px;
}
.remarks2 {
  position: relative;
 width: 384px;
  margin-top: 20px;
}
.digitalShowroom-p {
  width: 46px;
  height: 46px;
  position: absolute;
  top: 0px;
  right: 0px;

  z-index: 15;
}
</style>